<html>
	<head>
		<title>JS</title>
		<meta http-equiv="Content-Type content=text/html" charset=utf-8>
		
		<script>
			<!-- 表格 -->
			<!-- var a = 0; -->
			<!-- document.write("<table border=red align=center>") -->
			<!-- while (a <= 10) { -->
				<!-- if (a == 0) { -->
					<!-- document.write("<tr bgcolor=#777 align=center><td width=100 height=50>编号</td><td width=150>新闻标题</td><td width=100>发布时间</td></tr>"); -->
				<!-- } -->
				<!-- a++; -->
				<!-- if (a%2 == 0) { -->
					<!-- document.write("<tr bgcolor=#ccc><td width=100 height=50></td><td width=150></td><td width=100></td></tr>"); -->
				<!-- } else { -->
					<!-- document.write("<tr bgcolor=white><td width=100 height=50></td><td width=150></td><td width=100></td></tr>"); -->
				<!-- } -->
				
			<!-- } -->
			<!-- document.write("</table>"); -->
			
			<!-- 乘法表 -->
			<!-- document.write("<table border=1 align=center rules=all>"); -->
			<!-- for (var i = 1; i <= 9; i++) { -->
				<!-- document.write("<tr align=center>"); -->
				<!-- for (var j = 1; j <= i; j++) { -->
					<!-- document.write("<td width=60>" + (i + 'x' + j +'='+ i * j)+ "</td>"); -->
				<!-- } -->
				<!-- document.write("</tr>"); -->
			<!-- } -->
			<!-- document.write("</table>"); -->
			<!-- var arr = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; -->
			<!-- document.write('数组arr共有' + arr.length + '个数据'); -->
			<!-- document.write("<hr>"); -->
			<!-- var sum = 0; -->
			<!-- for (var i = 0; i < arr.length; i++) { -->
				<!-- <!-- document.write(arr[i] + ","); --> -->
				<!-- sum += arr[i]; -->
			<!-- } -->
			<!-- document.write(sum / arr.length); -->
			<!-- document.write("<hr>"); -->
			<!-- function getMax (a,b) { -->
				<!-- var max = 0;  -->
				<!-- if (a > b) { -->
					<!-- max = a; -->
				<!-- } else if(a < b) { -->
					<!-- max = b; -->
				<!-- } else { -->
					<!-- max = a; -->
				<!-- } -->
				
				<!-- return max; -->
			<!-- } -->
			
			<!-- getMax(10,20); -->
			<!-- document.write(getMax(10,20)); -->
			
			<!-- document.write("<hr />"); -->
			
			<!-- var name = "张三"; -->
			<!-- <!-- var age; --> -->
			<!-- function getInfo () { -->
				<!-- age = 24; -->
				<!-- document.write(name + "的年龄是" + age + "岁") -->
			<!-- } -->
			<!-- document.write(age); -->
			<!-- getInfo(); -->
			<!-- var a = 100; -->
			<!-- var b = a; -->
			<!-- a = 200; -->
			<!-- document.write(a + "<br />"); -->
			<!-- document.write(b + "<br />"); -->
			
			<!-- var arr1 = ['张三', 30, '男']; -->
			<!-- document.write(arr1 + "<br>"); -->
			<!-- var arr2 = arr1; -->
			<!-- document.write(arr2 + "<br>"); -->
			<!-- arr1[1] = 40; -->
			<!-- document.write(arr2); -->
			
			<!-- 匿名函数 -->
			<!-- var exmple = function (str) { -->
				<!-- document.write(str); -->
			<!-- } -->
			<!-- var str = '123456789'; -->
			<!-- exmple(str); -->
			
			<!-- var arr = ['张三', '男', ['2412868237', '2412868237@qq.com']]; -->
			<!-- var str = ''; -->
			<!-- str += "姓名：" + arr[0]; -->
			<!-- str += "<br />性别：" + arr[1]; -->
			<!-- str += "<br />QQ：" + arr[2][0]; -->
			<!-- str += "<br />邮箱：" + arr[2][1]; -->
			<!-- document.write(str); -->
			
			var arr = [
				["姓名", "性别", "年龄", "所在省份", "所在地市"],
				["郝龙晨", "男", 25, "山东省", "滨州市"],
				["郝志达", "男", 12, "山东省", "东营市"],
				["郝龙旭", "男", 12, "山东省", "滨州市"],
				["郝龙康", "男", 10, "山东省", "滨州市"],
				["郝龙阳", "男", 7, "山东省", "滨州市"],
				
			];
			var str= "";
			str += "<table align=center border=2 rules=all width=600>";
			str += "<caption>家庭人员统计表（男性）</caption>";
			for (var i = 0; i < arr.length; i++) {
				str += "<tr height=50px align=center>";
				for (var j = 0; j < arr[i].length; j++) {
					str += "<td width=100px >" + arr[i][j] + "</td>";
				}
				str += "</tr>";
			}
			str += "<table>";
			
			document.write(str);
		</script>
	</head>
	<body>
		
	</body>
</html>